# This file should contain all the record creation needed to seed the database with its default values.
# The data can then be loaded with the rake db:seed (or created alongside the db with db:setup).
#
# Examples:
#
#   cities = City.create([{ name: 'Chicago' }, { name: 'Copenhagen' }])
#   Mayor.create(name: 'Emanuel', city: cities.first)

OutletStatus.delete_all
outlet_statuses = OutletStatus.create([
	{ device_name: 'Headquarters', outlet_id: '1' , priority: '1' , status: 'true', user_override: 'false', or_time: Time.now},
	{ device_name: 'Mess Facility', outlet_id: '2' , priority: '2' , status: 'true', user_override: 'false', or_time: Time.now},
	{ device_name: 'Living Quarters', outlet_id: '3' , priority: '2' , status: 'true', user_override: 'false', or_time: Time.now},
	{ device_name: 'Shower Trucks', outlet_id: '4' , priority: '3' , status: 'true', user_override: 'false', or_time: Time.now},
	{ device_name: 'MWR Tent', outlet_id: '5' , priority: '3' , status: 'true', user_override: 'false', or_time: Time.now}])

	
UserSetting.delete_all
user_settings = UserSetting.create([
	{boxmanager_id: '1' , loadbox_id: '1' , algorithm_id: '1' , utility_control_lvl: '4' ,
	consumption_preference: '3' , green_input: 'false'}])
	
PowerLog.delete_all
power_logs = PowerLog.create([
{loadbox_id: '1' , logged_at: '10:55:00' , power_consumption: '150.0' , ppv: '315.0' , 
pgrid: '-165.0' , net_dollars: '4.00' , net_peak: '500.0' , net_off_peak: '15.0'},
{loadbox_id: '1' , logged_at: '11:00:00' , power_consumption: '250.0' , ppv: '327' , 
pgrid: '0.0' , net_dollars: '4.00' , net_peak: '600.0' , net_off_peak: '15.0'},
{loadbox_id: '1' , logged_at: '11:05:00' , power_consumption: '150.0' , ppv: '315.0' , 
pgrid: '0.0' , net_dollars: '4.00' , net_peak: '500.0' , net_off_peak: '15.0'},
{loadbox_id: '1' , logged_at: '11:10:00' , power_consumption: '150.0' , ppv: '315.0' , 
pgrid: '0.0' , net_dollars: '4.00' , net_peak: '500.0' , net_off_peak: '15.0'},
{loadbox_id: '1' , logged_at: '11:15:00' , power_consumption: '150.0' , ppv: '315.0' , 
pgrid: '0.0' , net_dollars: '4.00' , net_peak: '500.0' , net_off_peak: '15.0'}])
    
	
UtilitySetting.delete_all
utility_settings = UtilitySetting.create([{peak_start: '10:00:00' ,
	peak_end: '22:00:00' , peak_price: '0.20' , off_peak_price: '0.10' , override_lvl: '4'}])
	

Loadbox.delete_all
loadbox = Loadbox.create([{name: 'Loadbox1', boxmanager_id: '0', version_id: '1', interface_id: '1'}])

